package com.zm.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zm.demo.entry.PaperDetail;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zm
 * @since 2024-08-14
 */
public interface PaperDetailMapper extends BaseMapper<PaperDetail> {
    @Select("select * from paper_detail where pid = #{pid}")
    @Results(
            id = "rm1",
            value = {
                    @Result(column = "id",property = "id",id = true),
                    @Result(column = "qid",property = "qid"),
                    @Result(column = "qid",property = "question",
                            one = @One(select = "com.zm.demo.mapper.QuestionMapper.selectById"))
            }
    )
    public List<PaperDetail> findByPid(int pid);
}
